package net.hombrecero.bigbeat.model;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.OneToMany;

import org.hibernate.annotations.AccessType;

@Entity
@AccessType( "field" )
public class User extends Base {
	public static final int USERSTATUS_DISABLED = 1;
	public static final int USERSTATUS_ENABLED  = 2;



	@OneToMany( targetEntity = Node.class, mappedBy = "user" , cascade = { CascadeType.ALL } )
	private Set nodes = new HashSet();
	@Column( length=64, nullable = false )
	private String email;
	@Column( length=32, nullable = false )
	private String password;
	@Column( length=256, nullable = false )
	private String url;
	@Column( length=64, nullable = false )
	private String name;
	@Column( nullable = false )
	private int userStatus = USERSTATUS_DISABLED;



	public String getEmail() {
		return this.email;
	}
	public void setEmail( String email ) {
		this.email = email;
	}
	public String getPassword() {
		return this.password;
	}
	public void setPassword( String password ) {
		this.password = password;
	}
	public String getUrl() {
		return this.url;
	}
	public void setUrl( String url ) {
		this.url = url;
	}
	public String getName() {
		return this.name;
	}
	public void setName( String name ) {
		this.name = name;
	}
	public int getUserStatus() {
		return this.userStatus;
	}
	public void setUserStatus( int userStatus ) {
		this.userStatus = userStatus;
	}
	public Set getNodes() {
		return this.nodes;
	}
	public void setNodes( Set nodes ) {
		this.nodes = nodes;
	}
}
